package com.lm.activiti.boot.cases;

import org.joda.time.DateTime;
import org.junit.Test;

import java.util.Calendar;
import java.util.Date;

/**
 * @author lm_jcf
 * @date 2020/3/23 16:41
 */
public class DateTest {

    public static void main(String[] args) {

        long millisec = 1584952793000L;
        long millisec_2 = 1584952793000L;

        long dayMillisec = 60 * 60 * 24 * 1000;

        System.out.println(millisec / dayMillisec);
        System.out.println(1584892810000L / dayMillisec);
        System.out.println(1584979199000L / dayMillisec);

        System.out.println(1584979199000L - 1584892800000L);
        System.out.println(1584979199000L - 1584892800000L - dayMillisec);

    }

    @Test
    public void calendar(){
        Calendar calendar = Calendar.getInstance();

        calendar.setTime(new DateTime(2021,9,14,1,1,5).toDate());
        System.out.println(calendar.get(Calendar.DAY_OF_YEAR));

        calendar.setTime(new Date());
        System.out.println(calendar.get(Calendar.DAY_OF_YEAR));


    }

    @Test
    public void main2() {
        String s = "11";

        String ss;
        System.out.println(s == null ? "111" : (ss = s));

    }
}
